<!----***仅针对于工作台页面****----->
//关闭弹出窗口
function closewin(rtnValue)
{
window.returnValue=rtnValue;
window.close();
}
//关闭父窗口
function shutwin(){opener=null;self.close();}

//下拉菜单[1]
function show1(){
if (form2.select.value=="5")
{
layer5.style.display="";
}
else{
layer5.style.display="none";
}
if (form2.select.value=="6") {
layer6.style.display="";
}
else
{
layer6.style.display="none";
}
if (form2.select.value=="7") {
layer7.style.display="";
}
else
{
layer7.style.display="none";
}
}

//下拉菜单[2]
function show2(){
if (form3.select.value=="8")
{
layer8.style.display="";
}
else{
layer8.style.display="none";
}
if (form3.select.value=="9")
{
layer9.style.display="";
}
else{
layer9.style.display="none";
}
if (form3.select.value=="10")
{
layer10.style.display="";
}
else{
layer10.style.display="none";
}
}
//下拉菜单[3]
function show3(){
if (selectobj1.value=="11")
{
layer11.style.display="";
}
else{
layer11.style.display="none";
}
if (selectobj1.value=="12") {
layer12.style.display="";
}
else
{
layer12.style.display="none";
}
}
//下拉菜单[4]
function show4(){
if (form5.select.value=="13")
{
layer13.style.display="";
}
else{
layer13.style.display="none";
}
if (form5.select.value=="14") {
layer14.style.display="";
}
else
{
layer14.style.display="none";
}
if (form5.select.value=="15") {
layer15.style.display="";
}
else
{
layer15.style.display="none";
}
}

//下拉菜单[5]
function show6(){
if (form6.select.value=="20")
{
layer20.style.display="";
}
else{
layer20.style.display="none";
}
if (form6.select.value=="21") {
layer21.style.display="";
}
else
{
layer21.style.display="none";
}
if (form6.select.value=="22") {
layer22.style.display="";
}
else
{
layer22.style.display="none";
}
if (form6.select.value=="23") {
layer23.style.display="";
}
else
{
layer23.style.display="none";
}
if (form6.select.value=="24") {
layer24.style.display="";
}
else
{
layer24.style.display="none";
}
}
//下拉菜单[5]

//折扣管理新建下拉选择
function show_policy(myThis){

if (myThis.value=="1") //老业主推荐
{
layer1.style.display="";
layerPub1.style.display="none";
}
else{
layer1.style.display="none";
layerPub1.style.display="none";
}
if (myThis.value=="0") {//优惠金额
layer2.style.display="";
layerPub1.style.display="";
}
else
{
layer2.style.display="none";
}
if (myThis.value=="2") {//特价房
layer3.style.display="";
layerPub1.style.display="none";
}
else
{
layer3.style.display="none";
}
if (myThis.value=="3" || myThis.value=="4") {//费用优惠及送装修
layer1.style.display="";
layerPub1.style.display="";
}
else
{
}
if (myThis.value=="5") {//赠品
layer6.style.display="";
layerPub1.style.display="";
}
else
{
layer6.style.display="none";
}
if (myThis.value=="6") {//打折
layer7.style.display="";
layerPub1.style.display="block";
}
else
{
layer7.style.display="none";
}
}

//点击变灰
function onChecked(id,cbObj){
	var spanObj = document.getElementById(id);
	var objs1 = spanObj.getElementsByTagName("select");
    var objs2 = spanObj.getElementsByTagName("input");
	for (var i = 0; i < objs1.length; i++) {

		if(cbObj.checked == true){
			//alert('true');
			objs1[i].disabled = false;
		}else{
			objs1[i].disabled = true;
		}
	}
	for (var i = 0; i < objs2.length; i++) {
		if(cbObj.checked == true){
			//alert('true');
			objs2[i].disabled = false;
			if(objs2[i].type != "checkbox"){
                if(objs1[0].value == 0){
					objs2[i].className = "  required validate-integerBA";
				}else{
					objs2[i].className = "  required percent-rangeB";
				}
			}
		}else{
			objs2[i].disabled = true;
			objs2[i].value = "";
			Validation.reset(objs2[i]);
			objs2[i].className = "inputtext";

		}
	}
}
